#coding:utf-8
import os,sys
from pyh2 import *
reload(sys) 
sys.setdefaultencoding('utf-8')

# <button type="button" onclick="myFunction()">点击这里</button>
page = PyH('My wonderful PyH page')
page.addCSS('bootstrap.min.css')
page.addJS('jquery-3.1.1.min.js', 'bootstrap.min.js','myScript.js')
page << h1('My big title!', cl='myCSSclass')
page << div(id='mySubtitleDiv') << h2('My sub-title')
maindiv = page << div(id='myMainDiv')
maindiv << h3('A smaller title') + p('followed by a small paragraph')
maindiv << p('Main paragraph ', style='color:red;') << a('a link', href='http://alink')
maindiv << p(id='demo') << span('hehe', onclick='myFunction()')
# maindiv << button('点击这里',type="button",onclick='myFunction')
maindiv << br()
# <span class="label label-default">Default</span>
# <span class="label label-primary">Primary</span>
# <span class="label label-success">Success</span>
# <span class="label label-info">Info</span>
# <span class="label label-warning">Warning</span>
# <span class="label label-danger">Danger</span>
myspan = page << div(id='myFooter') << span('Default',cl='label label-default')+\
									   span('Primary',cl='label label-primary')+\
									   span('Success',cl='label label-success')+\
									   span('Info',cl='label label-info')+\
									   span('Warning',cl='label label-warning')+\
									   span('Danger',cl='label label-danger')

page.printOut()